// 分组管理页面逻辑
Page({
  data: {
    type: '',
    currentTeam: '',
    groups: []
  },
  onLoad: function(options) {
    this.setData({
      type: options.type,
      currentTeam: wx.getStorageSync('currentTeam'),
      groups: ['分组A', '分组B'] // 模拟分组数据
    })
  },
  // 创建分组
  createGroup: function(e) {
    const groupName = e.detail.value.groupName
    if (groupName) {
      this.data.groups.push(groupName)
      this.setData({
        groups: this.data.groups
      })
    }
  },
  // 进入分组
  enterGroup: function(e) {
    const groupName = e.currentTarget.dataset.groupname
    wx.navigateTo({
      url: `/pages/phrase/phrase?type=${this.data.type}&group=${groupName}`,
    })
  }
})
